begintownscript;
variables;

body;
beginstate INIT_STATE;
    if (get_flag(15, 4) == 1)
    {
        erase_char(53);
        erase_char(58);
        erase_char(59);
        erase_char(34);
        set_terrain(20, 23, 20);
    }
    set_name(53, "Nephil Overlord");
break;
beginstate EXIT_STATE;

break;
beginstate START_STATE;

break;
beginstate 10;
    if (get_flag(15, 0) == 0)
        message_dialog("You take a look at the fort. There are lots of rogue soldiers, human, nephil, and slith.", "Now the first thing to do is to find the naga. Then, when the orb is unlocked, it should be easy to take care of the rest.");
    set_flag(15, 0, 1);
break;
beginstate 11;
    if (get_flag(15, 1) == 0)
        message_dialog("Going into the barracks wasn't so wise after all. A fresh band of rogue soldiers has just rose up from their beds.", "");
    set_flag(15, 1, 1);
break;
beginstate 12;
    if (has_item(462))
    {
    if (get_flag(15, 2) == 0)
        message_dialog("The sliths have set up a small band and are now playing for a band of rogue soldiers. They don't seem to like it that you came in.", "");
    set_flag(15, 2, 1);
    }
    else
    {
        message_dialog("You have a bad feeling that there is an ambush inside the fort hall. Without the orb it can be difficult to deal with.", "Perhaps you should go find the naga first.");
        block_entry(1);
    }
break;
beginstate 13;
    if (get_flag(15, 3) == 0)
        message_dialog("The leader of the whole movement is a nephil. He is huge and wears the red coat of an overlord. He is with the leader of the human rebels and the sliths.", "When he sees you he commands the other rogues to attack.");
    set_flag(15, 3, 1);
break;
beginstate 14;
    if (get_flag(15, 4) == 0)
    {
        message_dialog("The Overlord realizes that you came through it's defense forces, so it flees in terror through a secret door in the back wall together with it's friends.", "");
        erase_char(53);
        erase_char(58);
        erase_char(59);
        set_terrain(20, 23, 20);
    }
    set_flag(15, 4, 1);
break;
beginstate 15;
    if (get_flag(15, 5) == 0)
        message_dialog("There can be many things up in a giant tree but you did not expect to find a small lake.", "");
    set_flag(15, 5, 1);
break;